/**
 * English description is not available for the problem. Please switch to Chinese.
 * <p>
 * <p>
 * Related Topics 数组 哈希表 排序 👍 1001 👎 0
 */

package com.xixi.basicAlgroithms.hash;

import java.util.HashSet;

public class ID_Offer_03_ShuZuZhongZhongFuDeShuZiLcof {
    public static void main(String[] args) {
        Solution solution = new ID_Offer_03_ShuZuZhongZhongFuDeShuZiLcof().new Solution();
    }

    //leetcode submit region begin(Prohibit modification and deletion)
    class Solution {
        public int findRepeatNumber(int[] nums) {
            HashSet<Integer> intSet = new HashSet<>();
            for (int i = 0; i < nums.length; i++) {
                int a = nums[i];
                if (intSet.contains(a)) {
                    return a;
                } else {
                    intSet.add(a);
                }


            }

            return 0;

        }
    }
//leetcode submit region end(Prohibit modification and deletion)


}